package com.zrwl.poscloud.xo.mapper;

import com.zrwl.poscloud.base.entity.ServerSyncRecord;
import com.zrwl.poscloud.base.superI.SuperMapper;
import com.zrwl.poscloud.xo.vo.ServerSyncRecordVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 服务器业务同步记录 Mapper类
 *
 * @author 刘思童 AutoGenerate
 * @date 2022-03-26
 */
public interface ServerSyncRecordMapper extends SuperMapper<ServerSyncRecord> {
    @Select("<script>" +
            " SELECT * FROM t_server_sync_record WHERE status=1 " +
            " GROUP BY uid,type " +
            " ORDER BY type,create_time ASC " +
            "</script>"
    )
    List<ServerSyncRecord> getCloudSyncDataList();

    @Select("<script>" +
            " SELECT * FROM t_server_sync_record WHERE company_uid=#{param.companyUid} AND type=#{param.type} AND create_time > #{param.createTime} " +
            " ORDER BY create_time ASC " +
            "</script>"
    )
    List<ServerSyncRecord> getServerSyncDataList(@Param("param") ServerSyncRecordVO serverSyncRecordVO);
}
